<template>
	<view class="executeResult">
		<uni-nav-bar
			color="#ffffff"
			background-color="#00aded"
			:statusBar="true"
			title="装货实绩"
			fixed="true"
			left-icon="left"
			left-text="作业"
			@clickLeft="back"
			@clickRight="arrow"
			right-text="首页"
			right-icon="right"
		></uni-nav-bar>
		<view class="executeResult_top">
			<!-- 搜索 -->
			<dil-search :columnData="options.columnDataList" @onSearch="onSearch" v-if="options.columnDataList.length > 0"></dil-search>
		</view>
		<view class="executeResult_main">
			<dil-card class="dilCard" @emitEvent="emitEvent" v-bind.sync="options"></dil-card>
		</view>
		<view class="executeResult_floot"></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			options: {
				requestUrl: '/api/v1/tms/getLoadResultList?apiId=601',
				requestQuery: {},
				cardSlotList: [],
				columnDataList: [],
				totalNum: 0
			}
		};
	},
	onShow() {
		uni.$emit('onShow', 1);

		this.getExecute();
	},
	mounted() {
		this.getExecuteDebounce = this.Tool.debounce((data) => {
			this.getExecute(data);
		}, 1500);
	},
	methods: {
		onSearch(item) {
			this.getExecuteDebounce(item);
		},
		back(item) {
			// #ifdef APP-PLUS
			uni.navigateBack();
			// #endif

			// #ifdef H5
			this.$router.back();
			// #endif
		},
		arrow() {
			uni.switchTab({
				url: '/pages/index/index'
			});
		},
		//获取执行实绩
		async getExecute(data = {}) {
			this.options.requestQuery = { ...data };
		}
	}
};
</script>

<style lang="scss" scoped>
.executeResult {
	width: 100vw;
	height: 100%;
	background-color: #f5f5f5;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	&_top {
		width: 100vw;
		flex: auto;
	}
}
</style>
